package tr.richfacesext.components.itemsorter;

import javax.faces.component.UIComponent;
import javax.faces.webapp.UIComponentTag;

import tr.richfacesext.components.ComponentUtils;

/**
 * 
 * @author mert
 *
 */
public class ItemSorterTag extends UIComponentTag {

	private String _value = null;
	private String _var = null;
	private String _width = null;
	
	public void release(){
		super.release();

		_value = null;
		_var = null;
		_width = null; 
	}

	protected void setProperties(UIComponent uicomponent){
		super.setProperties(uicomponent);

		ComponentUtils.setValueProperty(getFacesContext(), uicomponent, _value);
		ComponentUtils.setStringProperty(getFacesContext(), uicomponent, "var", _var);
		ComponentUtils.setIntegerProperty(getFacesContext(), uicomponent, "width", _width);
	}

	public String getComponentType() {
		return ItemSorterConstants.COMPONENT_TYPE;
	}

	public String getRendererType() {
		return ItemSorterConstants.DEFAULT_RENDERER;
	}

	public void setValue(String value){
		_value = value;
	}

	public void setVar(String value) {
		_var = value;
	}

	public void setWidth(String value) {
		_width = value;
	}
}